import time
import unittest
from selenium import webdriver
from unit_02.Page.Page import Page
from selenium.webdriver.common.by import By

class MyTestCase(unittest.TestCase):
    def setUp(self) -> None:
        print('start case')
        self.driver = webdriver.Firefox()
        # 浏览器事件 窗口最大化
        self.driver.maximize_window()

    def tearDown(self) -> None:
        print('end case')
        time.sleep(5)
        self.driver.quit()

    def test_01(self):
        po = Page(self.driver)
        po.login_luoji()
        # 隐式等待
        self.driver.implicitly_wait(5)
        # 断言 jxw824726828
        dy = self.driver.find_element(By.XPATH,'/html/body/div[2]/div/div[1]/div/p/span').text
        print('断言:',dy)
        self.assertEqual('jxw824726828',dy)
        time.sleep(2)



if __name__ == '__main__':
    unittest.main()
